package thinkingJava.chapter13;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class TestRegularExpression {
	public static void main(String[] args) {
		String s = "abcdefghijklabcabcabcabcabc3456zfesfabcdefg";
		String regex = "(abc){2,}";
		Pattern pa = Pattern.compile(regex);
		Matcher m = pa.matcher(s);
		while (m.find()) {
			System.out.println(m.group() + " : " + m.start() + " -- " + (m.end() - 1));
		}
	}
}
